home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap06 / DlgDemo5 / DlgDemo5.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.8 KB  |  90 lines

  1. //***********************************************************************
  2. //
  3. //  DlgDemo5.h
  4. //
  5. //***********************************************************************
  6.  
  7. typedef struct tagPROPERTIES
  8. {
  9.     int nFillType;
  10.     int nFillColor;
  11.     CString text;
  12.     int nHeight;
  13.     BOOL bBold;
  14.     BOOL bItalic;
  15. } PROPERTIES, * PPROPERTIES;
  16.  
  17. class CMyApp : public CWinApp
  18. {
  19. public:
  20.     virtual BOOL InitInstance ();
  21. };
  22.  
  23. class CSettingsDialog : public CDialog
  24. {
  25. public:
  26.     int m_nFillType;
  27.     int m_nFillColor;
  28.     CString m_text;
  29.     int m_nHeight;
  30.     BOOL m_bBold;
  31.     BOOL m_bItalic;
  32.  
  33. protected:
  34.     virtual void OnOK ();
  35.     virtual void OnCancel ();
  36.     virtual void DoDataExchange (CDataExchange*);
  37.     virtual void PostNcDestroy ();
  38.  
  39.     afx_msg void OnDefaults ();
  40.     DECLARE_MESSAGE_MAP ()
  41. };
  42.  
  43. class CMainWindow : public CFrameWnd
  44. {
  45.     friend void CSettingsDialog::PostNcDestroy ();
  46.  
  47. private:
  48.     int m_nFillType;
  49.     int m_nFillColor;
  50.     CString m_text;
  51.     int m_nHeight;
  52.     BOOL m_bBold;
  53.     BOOL m_bItalic;
  54.  
  55.     CSettingsDialog* m_pDlg;
  56.  
  57.     void DoSolidFill (CDC*, CRect*);
  58.     void DoGradientFill (CDC*, CRect*);
  59.     void DoDrawText (CDC*, CRect*);
  60.  
  61. public:
  62.     CMainWindow ();
  63.  
  64. protected:
  65.     afx_msg BOOL OnEraseBkgnd (CDC*);
  66.     afx_msg void OnPaint ();
  67.     afx_msg void OnOptionsSettings ();
  68.     afx_msg void OnOptionsExit ();
  69.     afx_msg void OnOptionsAbout ();
  70.     afx_msg LONG OnApplySettings (UINT, LONG);
  71.  
  72.     DECLARE_MESSAGE_MAP ()
  73. };
  74.  
  75. class CAboutDialog : public CDialog
  76. {
  77. private:
  78.     CRect m_rect;
  79.  
  80. public:
  81.     CAboutDialog (CWnd* pParentWnd = NULL) :
  82.         CDialog (IDD_ABOUTDLG, pParentWnd) {}
  83.  
  84.     virtual BOOL OnInitDialog ();
  85.  
  86. protected:
  87.     afx_msg void OnPaint ();
  88.     DECLARE_MESSAGE_MAP ()
  89. };
  90.